#include "internal.h"
#include <wgal.h>
#include <wgal/sfx.h>
#include <dsound.h>


LPDIRECTSOUND8 ds = NULL;

WGALAPI WGALBool wgalAudioInit()
{
	if(FAILED(DirectSoundCreate8(&DSDEVID_DefaultPlayback, &ds, NULL)))
	{
		return FALSE;
	}

	if(FAILED(ds->SetCooperativeLevel(hWnd, DSSCL_PRIORITY)))
	{
		ds->Release();
		return FALSE;
	}

	return TRUE;
}

WGALAPI WGALVoid wgalAudioDeinit()
{
	if(ds)
		ds->Release();
}